﻿#region Copyright

//  ======================================================
//      Copyright (c) 2011 Toulr All rights reserved.
//     
//      The use and distribution terms for this software are contained in the file
//      named license.txt, which can be found in the root of this distribution.
//      By using this software in any fashion, you are agreeing to be bound by the
//      terms of this license.
//     
//     You must not remove this notice, or any other, from this software.
//  ======================================================

#endregion

#region Using Namespaces

using System;
using System.ComponentModel.DataAnnotations;
using Toulr.Domains.System;

#endregion

namespace Toulr.Domains.Account
{
    public class User : IEntity
    {
        #region Property

        /// <summary>
        ///   用户标识
        /// </summary>
        [Key]
        public int Uid { get; set; }

        /// <summary>
        ///   用户登录名
        /// </summary>
        [MaxLength(64), Required]
        public String NickName { get; set; }

        [MaxLength(64)]
        public String FullName { get; set; }

        /// <summary>
        ///   性别
        /// </summary>
        public int Sex { get; set; }

        /// <summary>
        ///   登录密码
        /// </summary>
        [MaxLength(64)]
        public String Password { get; set; }

        /// <summary>
        ///   生日年
        /// </summary>
        public int BirthYear { get; set; }

        /// <summary>
        ///   月
        /// </summary>
        public int BirthMonth { get; set; }

        /// <summary>
        ///   日
        /// </summary>
        public int BirthDay { get; set; }

        /// <summary>
        ///   籍贯
        /// </summary>
        [MaxLength(64)]
        public String BirthPlace { get; set; }

        /// <summary>
        ///   电子邮件地址
        /// </summary>
        [MaxLength(128), Required]
        public String Email { get; set; }

        /// <summary>
        ///   用户MSN号码
        /// </summary>
        [MaxLength(128)]
        public String Msn { get; set; }

        /// <summary>
        ///   用户QQ号码
        /// </summary>
        [MaxLength(128)]
        public String QQ { get; set; }

        /// <summary>
        ///   用户联系电话
        /// </summary>
        [MaxLength(64)]
        public String Phone { get; set; }

        /// <summary>
        ///   用户手机号码
        /// </summary>
        [MaxLength(64)]
        public String MobilePhone { get; set; }

        /// <summary>
        ///   手机是否已验证
        /// </summary>
        public bool MobilePhoneVerified { get; set; }

        /// <summary>
        ///   邮件是否已验证
        /// </summary>
        public bool EmailVerified { get; set; }

        /// <summary>
        ///   证件类型
        /// </summary>
        public int IdentityType { get; set; }

        /// <summary>
        ///   标识号
        /// </summary>
        [MaxLength(64)]
        public String IdentityId { get; set; }

        /// <summary>
        ///   用户是否经过实名验证
        /// </summary>
        public bool Identitied { get; set; }

        /// <summary>
        ///   用户状态 激活、未激活
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        ///   注册时间
        /// </summary>
        [Required]
        public DateTime RegisterTime { get; set; }

        public float LongitudeToLive { get; set; }
        public float LatitudeToLive { get; set; }

        public float LongitudeToWork { get; set; }
        public float LatitudeToWork { get; set; }

        /// <summary>
        ///   用户登录标识描述，基于这个字段来判断用户是否已经登录，或者在页面跳转时传递用户登录状态等
        /// </summary>
        [MaxLength(128)]
        public String UserLoginCertificate { get; set; }
        
        /// <summary>
        ///   盐值
        /// </summary>
        [Required]
        public int SaltValue { get; set; }

        /// <summary>
        ///   城市ID
        /// </summary>
        public int UserCityId { get; set; }

        /// <summary>
        ///   用户通知设置信息Id
        /// </summary>
        public int UserNoticeConfigId { get; set; }

        /// <summary>
        /// 用户所属角色ID //todo 用户只能有一种角色？
        /// </summary>
        public int RoleId { get; set; }

        #endregion
    }
}